//===============================================================================
// Microsoft patterns & practices Enterprise Library Contribution
// Resource Application Block
//===============================================================================

using System;
using System.Diagnostics;
using System.ComponentModel;
using System.IO;
using System.Security.Permissions;
using System.Windows.Forms;
using System.Windows.Forms.Design;
using EntLibContrib.Resource.Configuration;

namespace EntLibContrib.Resource.Configuration.Design.Editors
{
  /// <summary>
  /// <para>Provides a user interface for selecting an Xml resource file name.</para>
  /// </summary>
  /// <seealso cref="FileNameEditor"/>
	[PermissionSet(SecurityAction.InheritanceDemand, Name = "FullTrust")]
	[PermissionSet(SecurityAction.LinkDemand, Name = "FullTrust")]
	public class XmlResourceFileNameEditor : FileResourceFileNameEditor
  {
		#region Public Methods
		/// <summary>
		/// Gets the file resource file filter.
		/// </summary>
		/// <returns>Open dialog file filter string</returns>
		public override string BuildFileResourceFileFilter()
		{
			return "Resources (*" + FindFileResourceNameExtension() + ") | *" + FindFileResourceNameExtension();
		}

		/// <summary>
		/// Gets the file resource name extension.
		/// </summary>
		/// <returns></returns>
		public override string FindFileResourceNameExtension()
		{
			return ResourceManagerSettings.XmlExtension;
		}
		#endregion
	}
}